package day09API.file;

import java.io.File;

public class Demo04 {
    public static void main(String[] args) {
        File file = new File("../jsd2107");
        File[] files = file.listFiles();
        System.out.println(files);

//        遍历文件目录
        for (File f:files){
//            String s = f.toString();
//            System.out.println(s);
            System.out.println(f);
        }

        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

        System.out.println(new File("./File/demo.txt").isDirectory());//判断是否为目录
        System.out.println(new File("./File/demo.txt").isFile());//判断是否为文件
    }
}
